From 2795200267e1eee9cca5dbefef608d1455894eb4 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 19 Mar 2008 10:21:01 +0000 Subject: [PATCH] tools: More accurate parsing of pci config. Signed-off-by: Yosuke Iwamatsu --- tools/python/xen/xend/server/pciif.py | 2 +- tools/python/xen/xm/create.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py index f3120e610b..e616ebfe11 100644 --- a/tools/python/xen/xend/server/pciif.py +++ b/tools/python/xen/xend/server/pciif.py @@ -177,7 +177,7 @@ class PciController(DevController): pci_match = re.match(r"((?P[0-9a-fA-F]{1,4})[:,])?" + r"(?P[0-9a-fA-F]{1,2})[:,]" + r"(?P[0-9a-fA-F]{1,2})[.,]" + - r"(?P[0-9a-fA-F]{1,2})", dev_config) + r"(?P[0-7]{1,2})$", dev_config) if pci_match!=None: pci_dev_info = pci_match.groupdict() diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index e61f4ba09a..a4e756825f 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -304,7 +304,7 @@ gopts.var('disk', val='phy:DEV,VDEV,MODE[,DOM]', gopts.var('pci', val='BUS:DEV.FUNC', fn=append_value, default=[], use="""Add a PCI device to a domain, using given params (in hex). - For example 'pci=c0:02.1a'. + For example 'pci=c0:02.1'. The option may be repeated to add more than one pci device.""") gopts.var('ioports', val='FROM[-TO]', @@ -844,7 +844,7 @@ def preprocess_pci(vals): pci_match = re.match(r"((?P[0-9a-fA-F]{1,4})[:,])?" + \ r"(?P[0-9a-fA-F]{1,2})[:,]" + \ r"(?P[0-9a-fA-F]{1,2})[.,]" + \ - r"(?P[0-9a-fA-F])", pci_dev_str) + r"(?P[0-7])$", pci_dev_str) if pci_match!=None: pci_dev_info = pci_match.groupdict('0') try: -- 2.30.2